const path = require('path');
const {sep} = path;
const glob = require('glob');
module.exports = (app)=>{
  const routerSchemaPath = path.resolve(app.businessPath,`.${sep}router-schema`)
  const filelist = glob.sync(path.resolve(routerSchemaPath,`.${sep}**${sep}**.js`));
  let routerSchema ={}
  filelist.forEach(file => {
    routerSchema={
      ...routerSchema,
      ...require(path.resolve(file))
    }
  })
  app.routerSchema = routerSchema
}